package org.kumas.sgrpc.common.serialize;

import java.io.IOException;
import java.util.Map;

public interface ObjectOutput extends DataOutput {

    void writeObject(Object obj) throws IOException;

    default void writeThrowable(Object obj) throws IOException {
        writeObject(obj);
    }

    default void writeEvent(Object data) throws IOException {
        writeObject(data);
    }

    default void writeAttachments(Map<String, Object> attachments) throws IOException {
        writeObject(attachments);
    }

}